<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  class Logs_Model extends CI_Model{
      function __construct() {
          parent::__construct();
      }
      function get_all_log($admin_id,$num,$offset){
          $this->db->where('admin_id',$admin_id);
          $this->db->order_by('date_log','DESC');
          return $this->db->get('logs',$num,$offset)->result();
      }
      
      function get_num_log($admin_id){
          $this->db->where('admin_id',$admin_id);
          return $this->db->get('logs')->num_rows();
      }
      
      function get_admin_by_id($admin_id){
          return $this->db->get_where('admin',array('admin_id'=>$admin_id))->row();
      }
  }
?>
